home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / QuickTime VR / MacOS / QuickDraw™ 3D 1.0.6F4 SDK / Development / RAVE DDK 1.0.6 GM for MacOS / Headers / RAVE.h < prev   
Encoding:
C/C++ Source or Header  |  1996-04-30  |  38.7 KB  |  1,026 lines  |  [TEXT/MPS ]

  1. /******************************************************************************
  2.  **                                                                             **
  3.  **     Module:        RAVE.h                                                     **
  4.  **                                                                          **
  5.  **     Purpose:     Header file for RAVE API                                 **
  6.  **                                                                          **
  7.  **     Author:        Mike W. Kelley                                             **
  8.  **                                                                          **
  9.  **     Copyright (C) 1994-96 Apple Computer, Inc.  All rights reserved.     **
  10.  **        OpenGL™ is a trademark of Silicon Graphics, Inc.                     **
  11.  **                                                                          **
  12.  *****************************************************************************/
  13.  
  14. #ifndef _RAVE_h
  15. #define _RAVE_h
  16.  
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20.  
  21. /******************************************************************************
  22.  *
  23.  * Platform macros.
  24.  * This sets kQAPlatform to one of kQAMacOS, kQAWin32, or kQAGeneric.
  25.  * kQAPlatform controls platform-specific compilation switches and types.
  26.  *
  27.  *****************************************************************************/
  28.  
  29. #if !defined(kQAMacOS)
  30. #define    kQAMacOS        1            /* Target is MacOS                    */
  31. #endif
  32.  
  33. #if !defined(kQAGeneric)
  34. #define kQAGeneric        2            /* Target is generic platform        */
  35. #endif
  36.  
  37. #if !defined(kQAWin32)
  38. #define kQAWin32        3            /* Target is Win32                    */
  39. #endif
  40.  
  41. #if defined(_WIN32) || defined(_WINDOWS)
  42.     #define kQAPlatform kQAWin32
  43. #elif !defined(kQAPlatform)
  44.     #define kQAPlatform kQAMacOS
  45. #endif
  46.  
  47. /******************************************************************************
  48.  *
  49.  * Export Control
  50.  *
  51.  *****************************************************************************/
  52.  
  53. #if defined(_MSC_VER)    /* Microsoft Visual C */
  54.     #define    RAVE_EXPORT        __declspec( dllexport )
  55. #else
  56.     #define RAVE_EXPORT
  57. #endif /* _MSC_VER */
  58.  
  59. /******************************************************************************
  60.  *
  61.  * Platform dependent datatypes: TQAImagePixelType, TQADevice, TQAClip, and TQARect.
  62.  *
  63.  *****************************************************************************/
  64.  
  65. typedef enum TQAImagePixelType
  66. {
  67.     kQAPixel_Alpha1        = 0,        /* 1 bit/pixel alpha */
  68.     kQAPixel_RGB16        = 1,        /* 16 bit/pixel, R=14:10, G=9:5, B=4:0 */
  69.     kQAPixel_ARGB16        = 2,        /* 16 bit/pixel, A=15, R=14:10, G=9:5, B=4:0 */
  70.     kQAPixel_RGB32        = 3,        /* 32 bit/pixel, R=23:16, G=15:8, B=7:0 */
  71.     kQAPixel_ARGB32        = 4,        /* 32 bit/pixel, A=31:24, R=23:16, G=15:8, B=7:0 */
  72.     kQAPixel_CL4        = 5,        /* 4 bit color look up table, always big endian,
  73.                                         ie high 4 bits effect left pixel */
  74.     kQAPixel_CL8        = 6            /* 8 bit color look up table */
  75. } TQAImagePixelType;
  76.  
  77. typedef enum TQAColorTableType
  78. {
  79.     kQAColorTable_CL8_RGB32        = 0,        /* 256 entry, 32 bit/pixel, R=23:16, G=15:8, B=7:0 */
  80.     kQAColorTable_CL4_RGB32        = 1            /* 16 entry, 32 bit/pixel, R=23:16, G=15:8, B=7:0 */
  81. } TQAColorTableType;
  82.  
  83. typedef enum TQADeviceType            /* Selects target device type */
  84. {
  85.     kQADeviceMemory        = 0,        /* Memory draw context */
  86.     kQADeviceGDevice    = 1,        /* Macintosh GDevice draw context */
  87.     kQADeviceWin32DC    = 2,        /* Win32 DC  */
  88.     kQADeviceDDSurface    = 3            /* Win32 DirectDraw Surface */
  89. } TQADeviceType;
  90.  
  91. typedef struct TQADeviceMemory        /* Generic memory pixmap device */
  92. {
  93.     long                rowBytes;    /* Rowbytes */
  94.     TQAImagePixelType    pixelType;    /* Depth, color space, etc. */
  95.     long                width;        /* Width in pixels */
  96.     long                height;        /* Height in pixels */
  97.     void                *baseAddr;    /* Base address of pixmap */
  98. } TQADeviceMemory;
  99.  
  100. typedef enum TQAClipType            /* Selects target clip type */
  101. {
  102.     kQAClipRgn            = 0,        /* Macintosh clipRgn with serial number */
  103.     kQAClipWin32Rgn        = 1            /* Win32 clip region */
  104. } TQAClipType;
  105.  
  106. typedef struct TQARect
  107. {
  108.     long                left;
  109.     long                right;
  110.     long                top;
  111.     long                bottom;
  112. } TQARect;
  113.  
  114. #if (kQAPlatform == kQAMacOS)
  115.     /*
  116.      * MacOS supports memory and GDevice. TQARect == Rect. TQAClip is a clipRgn.
  117.      */
  118.     
  119.     #include <Quickdraw.h>
  120.     #include <QDOffscreen.h>
  121.     
  122.     typedef union TQAPlatformDevice
  123.     {
  124.         TQADeviceMemory    memoryDevice;
  125.         GDHandle        gDevice;
  126.     } TQAPlatformDevice;
  127.     
  128.     typedef union TQAPlatformClip
  129.     {
  130.         RgnHandle        clipRgn;
  131.     } TQAPlatformClip;
  132.     
  133. #elif (kQAPlatform == kQAWin32)
  134.     /*
  135.      * Win32 platform. TQARect is generic. TQAPlatform is DC or Surface. TQAClip is HRGN.
  136.      */
  137.     #include <windows.h>
  138.     #include <ddraw.h>
  139.  
  140.     typedef union TQAPlatformDevice
  141.     {
  142.         TQADeviceMemory            memoryDevice;
  143.         HDC                        hdc;
  144.         struct
  145.         {
  146.             LPDIRECTDRAW            lpDirectDraw;
  147.             LPDIRECTDRAWSURFACE        lpDirectDrawSurface;
  148.         };
  149.     } TQAPlatformDevice;
  150.  
  151.     typedef union TQAPlatformClip
  152.     {
  153.         HRGN            clipRgn;
  154.     } TQAPlatformClip;
  155. #elif (kQAPlatform == kQAGeneric)
  156.     /*
  157.      * Generic platform supports memory device only. TQARect is generic. TQAClip is ???.
  158.      */
  159.     
  160.     typedef union TQAPlatformDevice
  161.     {
  162.         TQADeviceMemory    memoryDevice;
  163.     } TQAPlatformDevice;
  164.     
  165.     typedef union TQAPlatformClip
  166.     {
  167.         void            *region;            /* ??? */
  168.     } TQAPlatformClip;
  169. #else
  170.     ??? Unrecognized kQAPlatform
  171. #endif
  172.  
  173. typedef struct TQADevice
  174. {
  175.     TQADeviceType        deviceType;
  176.     TQAPlatformDevice    device;
  177. } TQADevice;
  178.  
  179. typedef struct TQAClip
  180. {
  181.     TQAClipType            clipType;
  182.     TQAPlatformClip        clip;
  183. } TQAClip;
  184.  
  185. /******************************************************************************
  186.  *
  187.  * Basic data types.
  188.  *
  189.  *****************************************************************************/
  190.  
  191. typedef struct    TQADrawContext TQADrawContext;    /* Drawing context for an engine */
  192. typedef struct    TQAEngine TQAEngine;            /* Pointer to a drawing engine */
  193. typedef struct    TQATexture TQATexture;            /* Pointer to an allocated texture map */
  194. typedef struct    TQABitmap TQABitmap;            /* Pointer to an allocated bitmap */
  195. typedef struct    TQADrawPrivate TQADrawPrivate;    /* Engine's private draw context pointer */
  196. typedef struct    TQAImage TQAImage;                /* An image for use as texture or bitmap */
  197. typedef struct    TQAColorTable TQAColorTable;
  198.  
  199. typedef struct TQAIndexedTriangle                /* A single triangle element for QADrawTriMesh */
  200. {
  201.     unsigned long    triangleFlags;                /* Triangle flags, see kQATriFlags_ */
  202.     unsigned long    vertices[3];                /* Indices into a vertex array */
  203. } TQAIndexedTriangle;
  204.  
  205. struct TQAImage                                    /* An image for use as texture or bitmap */
  206. {
  207.     long        width;                            /* Width of pixmap */
  208.     long        height;                            /* Height of pixmap */
  209.     long        rowBytes;                        /* Rowbytes of pixmap */
  210.     void        *pixmap;                        /* Pixmap */
  211. };
  212.  
  213. typedef enum TQAError                            /* Standard error type */
  214. {
  215.     kQANoErr                = 0,                /* No error */
  216.     kQAError                = 1,                /* Generic error flag */
  217.     kQAOutOfMemory            = 2,                /* Insufficient memory */
  218.     kQANotSupported            = 3,                /* Requested feature is not supported */
  219.     kQAOutOfDate            = 4,                /* A newer drawing engine was registered */
  220.     kQAParamErr                = 5,                /* Error in passed parameters */
  221. #ifdef RAVE_1_1
  222.     kQAGestaltUnknown        = 6,                /* Requested gestalt type isn't available */
  223.     kQADisplayModeUnsupported    = 7                /* Engine cannot render to the display in its current ,
  224.                                                  * mode, but could if it were in some other mode */
  225. #else
  226.     kQAGestaltUnknown        = 6                    /* Requested gestalt type isn't available */
  227. #endif
  228. } TQAError;
  229.  
  230. /************************************************************************************************
  231.  *
  232.  * Vertex data types.
  233.  *
  234.  ***********************************************************************************************/
  235.  
  236. /*
  237.  * TQAVGouraud is used for Gouraud shading. Each vertex specifies position, color and Z.
  238.  *
  239.  * Alpha is always treated as indicating transparency. Drawing engines which don't
  240.  * support Z-sorted rendering use the back-to-front transparency blending functions
  241.  * shown below. (ARGBsrc are the source (new) values, ARGBdest are  the destination
  242.  * (previous) pixel values.)
  243.  *
  244.  *        Premultiplied                            Interpolated
  245.  *
  246.  *        A = 1 - (1 - Asrc) * (1 - Adest)        A = 1 - (1 - Asrc) * (1 - Adest) 
  247.  *        R = (1 - Asrc) * Rdest + Rsrc            R = (1 - Asrc) * Rdest + Asrc * Rsrc
  248.  *        G = (1 - Asrc) * Gdest + Gsrc            G = (1 - Asrc) * Gdest + Asrc * Gsrc
  249.  *        B = (1 - Asrc) * Bdest + Bsrc            B = (1 - Asrc) * Bdest + Asrc * Bsrc
  250.  *
  251.  * Note that the use of other blending modes to implement antialiasing is performed
  252.  * automatically by the drawing engine when the kQATag_Antialias variable !=
  253.  * kQAAntiAlias_Fast. The driving software should continue to use the alpha fields
  254.  * for transparency even when antialiasing is being used (the drawing engine will
  255.  * resolve the multiple blending requirements as best as it can).
  256.  *
  257.  * Drawing engines which perform front-to-back Z-sorted rendering should replace
  258.  * the blending function shown above with the equivalent front-to-back formula.
  259.  */
  260.  
  261. typedef struct TQAVGouraud
  262. {
  263.     float                x;        /* X pixel coordinate, 0.0 <= x < width */
  264.     float                y;        /* Y pixel coordinate, 0.0 <= y < height */
  265.     float                z;        /* Z coordinate, 0.0 <= z <= 1.0 */
  266.     float                invW;    /* 1 / w; required only when kQAPerspectiveZ_On is set */
  267.     
  268.     float                r;        /* Red, 0.0 <= r <= 1.0 */
  269.     float                g;        /* Green, 0.0 <= g <= 1.0 */
  270.     float                b;        /* Blue, 0.0 <= b <= 1.0 */
  271.     float                a;        /* Alpha, 0.0 <= a <= 1.0, 1.0 is opaque */
  272. } TQAVGouraud;
  273.  
  274. /*
  275.  * TQAVTexture is used for texture mapping. The texture mapping operation
  276.  * is controlled by the kQATag_TextureOp variable, which is a mask of
  277.  * kQATextureOp_None/Modulate/Highlight/Decal. Below is pseudo-code for the
  278.  * texture shading operation:
  279.  *
  280.  *        texPix = TextureLookup (uq/q, vq/q);
  281.  *        if (kQATextureOp_Decal)
  282.  *        {
  283.  *            texPix.r = texPix.a * texPix.r + (1 - texPix.a) * r;
  284.  *            texPix.g = texPix.a * texPix.g + (1 - texPix.a) * g;
  285.  *            texPix.b = texPix.a * texPix.b + (1 - texPix.a) * b;
  286.  *            texPix.a = a;
  287.  *        }
  288.  *        else
  289.  *        {
  290.  *            texPix.a = texPix.a * a;
  291.  *        }
  292.  *        if (kQATextureOp_Modulate)
  293.  *        {
  294.  *            texPix.r *= kd_r;        // Clamped to prevent overflow
  295.  *            texPix.g *= kd_g;        // Clamped to prevent overflow
  296.  *            texPix.b *= kd_b;        // Clamped to prevent overflow
  297.  *        }
  298.  *        if (kQATextureOp_Highlight)
  299.  *        {
  300.  *            texPix.r += ks_r;        // Clamped to prevent overflow
  301.  *            texPix.g += ks_g;        // Clamped to prevent overflow
  302.  *            texPix.b += ks_b;        // Clamped to prevent overflow
  303.  *        }
  304.  *
  305.  * After computation of texPix, transparency blending (as shown
  306.  * above for TQAVGouraud) is performed.
  307.  */
  308.  
  309. typedef struct TQAVTexture
  310. {
  311.     float                x;        /* X pixel coordinate, 0.0 <= x < width */
  312.     float                y;        /* Y pixel coordinate, 0.0 <= y < height */
  313.     float                z;        /* Z coordinate, 0.0 <= z <= 1.0 */
  314.     float                invW;    /* 1 / w (always required) */
  315.     
  316.     /* rgb are used only when kQATextureOp_Decal is set. a is always required */
  317.     
  318.     float                r;        /* Red, 0.0 <= r <= 1.0 */
  319.     float                g;        /* Green, 0.0 <= g <= 1.0 */
  320.     float                b;        /* Blue, 0.0 <= b <= 1.0 */
  321.     float                a;        /* Alpha, 0.0 <= a <= 1.0, 1.0 is opaque */
  322.  
  323.     /* uOverW and vOverW are required by all modes */
  324.     
  325.     float                uOverW;    /* u / w */
  326.     float                vOverW;    /* v / w */
  327.     
  328.     /* kd_r/g/b are used only when kQATextureOp_Modulate is set */
  329.     
  330.     float                kd_r;    /* Scale factor for texture red, 0.0 <= kd_r */
  331.     float                kd_g;    /* Scale factor for texture green, 0.0 <= kd_g */
  332.     float                kd_b;    /* Scale factor for texture blue, 0.0 <= kd_b */
  333.     
  334.     /* ks_r/g/b are used only when kQATextureOp_Highlight is set */
  335.     
  336.     float                ks_r;    /* Red specular highlight, 0.0 <= ks_r <= 1.0 */
  337.     float                ks_g;    /* Green specular highlight, 0.0 <= ks_g <= 1.0 */
  338.     float                ks_b;    /* Blue specular highlight, 0.0 <= ks_b <= 1.0 */
  339. } TQAVTexture;
  340.  
  341. /************************************************************************************************
  342.  *
  343.  * Constants used for the state variables.
  344.  *
  345.  ***********************************************************************************************/
  346.  
  347. /*
  348.  * kQATag_xxx is used to select a state variable when calling QASetFloat(), QASetInt(),
  349.  * QAGetFloat() and QAGetInt(). The kQATag values are split into two separate
  350.  * enumerated types: TQATagInt and TQATagFloat. TQATagInt is used for the QASet/GetInt()
  351.  * functions, and TQATagFloat is used for the QASet/GetFloat() functions. (This is so
  352.  * that a compiler that typechecks enums can flag a float/int tag mismatch during compile.)
  353.  *
  354.  * These variables are required by all drawing engines:
  355.  *        kQATag_ZFunction            (Int)    One of kQAZFunction_xxx
  356.  *        kQATag_ColorBG_a            (Float)    Background color alpha
  357.  *        kQATag_ColorBG_r            (Float)    Background color red
  358.  *        kQATag_ColorBG_g            (Float)    Background color green
  359.  *        kQATag_ColorBG_b            (Float)    Background color blue
  360.  *        kQATag_Width                (Float)    Line and point width (pixels)
  361.  *        kQATag_ZMinOffset            (Float)    Min offset to Z to guarantee visibility (Read only!)
  362.  *        kQATag_ZMinScale            (Float)    Min scale to Z to guarantee visibility (Read only!)
  363.  
  364.  * These variables are used for optional features:
  365.  *        kQATag_Antialias            (Int)    One of kQAAntiAlias_xxx
  366.  *        kQATag_Blend                (Int)    One of kQABlend_xxx
  367.  *        kQATag_PerspectiveZ            (Int)    One of kQAPerspectiveZ_xxx
  368.  *        kQATag_TextureFilter        (Int)    One of kQATextureFilter_xxx
  369.  *        kQATag_TextureOp            (Int)    Mask of kQATextureOp_xxx
  370.  *        kQATag_Texture                (Int)    Pointer to current TQATexture
  371.  *        kQATag_CSGTag                (Int)    One of kQACSGTag_xxx
  372.  *        kQATag_CSGEquation            (Int)    32 bit CSG truth table
  373.  *
  374.  * These variables are used for OpenGL™ support:
  375.  *        kQATagGL_DrawBuffer            (Int)    Mask of kQAGL_DrawBuffer_xxx
  376.  *        kQATagGL_TextureWrapU        (Int)    kQAGL_Clamp or kQAGL_Repeat
  377.  *        kQATagGL_TextureWrapV        (Int)    kQAGL_Clamp or kQAGL_Repeat
  378.  *        kQATagGL_TextureMagFilter    (Int)    kQAGL_Nearest or kQAGL_Linear
  379.  *        kQATagGL_TextureMinFilter    (Int)    kQAGL_Nearest, etc.
  380.  *        kQATagGL_ScissorXMin        (Int)    Minimum X value for scissor rectangle
  381.  *        kQATagGL_ScissorYMin        (Int)    Minimum Y value for scissor rectangle
  382.  *        kQATagGL_ScissorXMax        (Int)    Maximum X value for scissor rectangle
  383.  *        kQATagGL_ScissorYMax        (Int)    Maximum Y value for scissor rectangle
  384.  *        kQATagGL_BlendSrc            (Int)    Source blending operation
  385.  *        kQATagGL_BlendDst            (Int)    Destination blending operation
  386.  *        kQATagGL_LinePattern        (Int)    Line rasterization pattern
  387.  *        kQATagGL_AreaPattern0        (Int)    First of 32 area pattern registers
  388.  *        kQATagGL_AreaPattern31        (Int)    Last of 32 area pattern registers
  389.  *        kQATagGL_DepthBG            (Float)    Background Z
  390.  *        kQATagGL_TextureBorder_a    (Float)    Texture border color alpha
  391.  *        kQATagGL_TextureBorder_r    (Float)    Texture border color red
  392.  *        kQATagGL_TextureBorder_g    (Float)    Texture border color green
  393.  *        kQATagGL_TextureBorder_b    (Float)    Texture border color blue
  394.  *
  395.  * Tags >= kQATag_EngineSpecific_Minimum may be assigned by the vendor for use as
  396.  * engine-specific variables. NOTE: These should be used only in exceptional circumstances,
  397.  * as functions performed by these variables won't be generally accessible. All other tag
  398.  * values are reserved.
  399.  *
  400.  *        kQATag_EngineSpecific_Minimum    Minimum tag value for drawing-engine specific variables
  401.  */
  402.  
  403. typedef enum TQATagInt
  404. {
  405.     kQATag_ZFunction                = 0,
  406.     kQATag_Antialias                = 8,
  407.     kQATag_Blend                    = 9,
  408.     kQATag_PerspectiveZ                = 10,
  409.     kQATag_TextureFilter            = 11,
  410.     kQATag_TextureOp                = 12,
  411.     kQATag_CSGTag                    = 14,
  412.     kQATag_CSGEquation                = 15,
  413.     kQATagGL_DrawBuffer                = 100,
  414.     kQATagGL_TextureWrapU            = 101,
  415.     kQATagGL_TextureWrapV            = 102,
  416.     kQATagGL_TextureMagFilter        = 103,
  417.     kQATagGL_TextureMinFilter        = 104,
  418.     kQATagGL_ScissorXMin            = 105,
  419.     kQATagGL_ScissorYMin            = 106,
  420.     kQATagGL_ScissorXMax            = 107,
  421.     kQATagGL_ScissorYMax            = 108,
  422.     kQATagGL_BlendSrc                = 109,
  423.     kQATagGL_BlendDst                = 110,
  424.     kQATagGL_LinePattern            = 111,
  425.     kQATagGL_AreaPattern0            = 117,
  426.         /* ...1-30 */
  427.     kQATagGL_AreaPattern31            = 148,
  428.     kQATag_EngineSpecific_Minimum    = 1000
  429. } TQATagInt;
  430.  
  431. typedef enum TQATagPtr
  432. {
  433.     kQATag_Texture                    = 13
  434. } TQATagPtr;
  435.  
  436. typedef enum TQATagFloat
  437. {
  438.     kQATag_ColorBG_a                = 1,
  439.     kQATag_ColorBG_r                = 2,
  440.     kQATag_ColorBG_g                = 3,
  441.     kQATag_ColorBG_b                = 4,
  442.     kQATag_Width                    = 5,
  443.     kQATag_ZMinOffset                = 6,
  444.     kQATag_ZMinScale                = 7,
  445.     kQATagGL_DepthBG                = 112,
  446.     kQATagGL_TextureBorder_a        = 113,
  447.     kQATagGL_TextureBorder_r        = 114,
  448.     kQATagGL_TextureBorder_g        = 115,
  449.     kQATagGL_TextureBorder_b        = 116
  450. } TQATagFloat;
  451.  
  452. /* kQATag_ZFunction */
  453. #define kQAZFunction_None            0    /* Z is neither tested nor written (same as no Z buffer) */
  454. #define kQAZFunction_LT                1    /* Znew < Zbuffer is visible */
  455. #define kQAZFunction_EQ                2    /* Znew == Zbuffer is visible */
  456. #define kQAZFunction_LE                3    /* Znew <= Zbuffer is visible */
  457. #define kQAZFunction_GT                4    /* Znew > Zbuffer is visible */
  458. #define kQAZFunction_NE                5    /* Znew != Zbuffer is visible */
  459. #define kQAZFunction_GE                6    /* Znew >= Zbuffer is visible */
  460. #define kQAZFunction_True            7    /* Znew is always visible */
  461.  
  462. /* kQATag_Width */
  463. #define kQAMaxWidth                    128.0
  464.  
  465. /* kQATag_Antialias */
  466. #define kQAAntiAlias_Off            0
  467. #define kQAAntiAlias_Fast            1
  468. #define kQAAntiAlias_Mid            2
  469. #define kQAAntiAlias_Best            3
  470.  
  471. /* kQATag_Blend */
  472. #define kQABlend_PreMultiply        0
  473. #define kQABlend_Interpolate        1
  474. #define kQABlend_OpenGL                2
  475.  
  476. /* kQATag_PerspectiveZ */
  477. #define kQAPerspectiveZ_Off            0    /* Use Z for hidden surface removal */
  478. #define kQAPerspectiveZ_On            1    /* Use InvW for hidden surface removal */
  479.  
  480. /* kQATag_TextureFilter */
  481. #define kQATextureFilter_Fast        0
  482. #define kQATextureFilter_Mid        1
  483. #define kQATextureFilter_Best        2
  484.  
  485. /* kQATag_TextureOp (mask of one or more) */
  486. #define kQATextureOp_None        0                /* Default texture mapping mode */
  487. #define kQATextureOp_Modulate    (1 << 0)        /* Modulate texture color with kd_r/g/b */
  488. #define kQATextureOp_Highlight    (1 << 1)        /* Add highlight value ks_r/g/b */
  489. #define kQATextureOp_Decal        (1 << 2)        /* When texture alpha == 0, use rgb instead */
  490. #define kQATextureOp_Shrink        (1 << 3)        /* This is a non-wrapping texture, so the ??? */
  491.  
  492. /* kQATag_CSGTag */
  493. #define kQACSGTag_None            0xffffffffUL    /* Do not perform CSG */
  494. #define kQACSGTag_0                0                /* Submitted tris have CSG ID 0 */
  495. #define kQACSGTag_1                1                /* Submitted tris have CSG ID 1 */
  496. #define kQACSGTag_2                2                /* Submitted tris have CSG ID 2 */
  497. #define kQACSGTag_3                3                /* Submitted tris have CSG ID 3 */
  498. #define kQACSGTag_4                4                /* Submitted tris have CSG ID 4 */
  499.  
  500. /* kQATagGL_TextureWrapU/V */
  501. #define kQAGL_Repeat                0
  502. #define kQAGL_Clamp                    1
  503.  
  504. /* kQATagGL_BlendSrc */
  505. #define kQAGL_SourceBlend_XXX        0
  506.  
  507. /* kQATagGL_BlendDst */
  508. #define kQAGL_DestBlend_XXX            0
  509.  
  510. /* kQATagGL_DrawBuffer (mask of one or more) */
  511. #define kQAGL_DrawBuffer_None        0
  512. #define kQAGL_DrawBuffer_FrontLeft    (1<<0)
  513. #define kQAGL_DrawBuffer_FrontRight    (1<<1)
  514. #define kQAGL_DrawBuffer_BackLeft    (1<<2)
  515. #define kQAGL_DrawBuffer_BackRight    (1<<3)
  516. #define kQAGL_DrawBuffer_Front        (kQAGL_DrawBuffer_FrontLeft | kQAGL_DrawBuffer_FrontRight)
  517. #define kQAGL_DrawBuffer_Back        (kQAGL_DrawBuffer_BackLeft | kQAGL_DrawBuffer_BackRight)
  518.  
  519. /************************************************************************************************
  520.  *
  521.  * Constants used as function parameters.
  522.  *
  523.  ***********************************************************************************************/
  524.  
  525. /*
  526.  * TQAVertexMode is a parameter to QADrawVGouraud() and QADrawVTexture() that specifies how
  527.  * to interpret and draw the vertex array.
  528.  */
  529.  
  530. typedef enum TQAVertexMode
  531. {
  532.     kQAVertexMode_Point                = 0,        /* Draw nVertices points */
  533.     kQAVertexMode_Line                = 1,        /* Draw nVertices/2 line segments */
  534.     kQAVertexMode_Polyline            = 2,        /* Draw nVertices-1 connected line segments */
  535.     kQAVertexMode_Tri                = 3,        /* Draw nVertices/3 triangles */
  536.     kQAVertexMode_Strip                = 4,        /* Draw nVertices-2 triangles as a strip */
  537.     kQAVertexMode_Fan                = 5            /* Draw nVertices-2 triangles as a fan from v0 */
  538. } TQAVertexMode;
  539.  
  540. /*
  541.  * TQAGestaltSelector is a parameter to QAEngineGestalt(). It selects which gestalt
  542.  * parameter will be copied into 'response'.
  543.  */
  544.  
  545. typedef enum TQAGestaltSelector
  546. {
  547.     kQAGestalt_OptionalFeatures        = 0,        /* Mask of one or more kQAOptional_xxx */
  548.     kQAGestalt_FastFeatures            = 1,        /* Mask of one or more kQAFast_xxx */
  549.     kQAGestalt_VendorID                = 2,        /* Vendor ID */
  550.     kQAGestalt_EngineID                = 3,        /* Engine ID */
  551.     kQAGestalt_Revision                = 4,        /* Revision number of this engine */
  552.     kQAGestalt_ASCIINameLength        = 5,        /* strlen (asciiName) */
  553.     kQAGestalt_ASCIIName            = 6            /* Causes strcpy (response, asciiName) */
  554. } TQAGestaltSelector;
  555.  
  556. #ifdef RAVE_1_1
  557.  
  558. /*
  559.  * TQAMethodSelector is a parameter to QASetNoticeMethod to select the notice method
  560.  */
  561.  
  562. typedef enum TQAMethodSelector
  563. {
  564.     kQAMethod_RenderCompletion        = 0
  565.     
  566. } TQAMethodSelector;
  567.  
  568. #endif
  569.  
  570. /*
  571.  * kQATriFlags_xxx are ORed together to generate the 'flags' parameter
  572.  * to QADrawTriGouraud() and QADrawTriTexture().
  573.  */
  574.  
  575. #define    kQATriFlags_None            0            /* No flags (triangle is front-facing or don't care) */
  576. #define kQATriFlags_Backfacing        (1 << 0)    /* Triangle is back-facing */
  577.  
  578. /*
  579.  * kQATexture_xxx are ORed together to generate the 'flags' parameter to QATextureNew().
  580.  */
  581.  
  582. #define    kQATexture_None                0            /* No flags */
  583. #define kQATexture_Lock                (1<<0)        /* Don't swap this texture out */
  584. #define kQATexture_Mipmap            (1<<1)        /* This texture is mipmapped */
  585. #define kQATexture_NoCompression    (1<<2)        /* Do not compress this texture */
  586. #define kQATexture_HighCompression    (1<<3)        /* Compress texture, even if it takes a while */
  587.  
  588. /*
  589.  * kQABitmap_xxx are ORed together to generate the 'flags' parameter to QABitmapNew().
  590.  */
  591.  
  592. #define    kQABitmap_None                0            /* No flags */
  593. #define kQABitmap_Lock                (1<<1)        /* Don't swap this bitmap out */
  594. #define kQABitmap_NoCompression        (1<<2)        /* Do not compress this bitmap */
  595. #define kQABitmap_HighCompression    (1<<3)        /* Compress bitmap, even if it takes a while */
  596.  
  597. /*
  598.  * kQAContext_xxx are ORed together to generate the 'flags' parameter for QADrawContextNew().
  599.  */
  600.  
  601. #define kQAContext_None                0            /* No flags */
  602. #define kQAContext_NoZBuffer        (1 << 0)    /* No hidden surface removal */
  603. #define kQAContext_DeepZ            (1 << 1)    /* Hidden surface precision >= 24 bits */
  604. #define kQAContext_DoubleBuffer        (1 << 2)    /* Double buffered window */
  605. #define kQAContext_Cache            (1 << 3)    /* This is a cache context */
  606.  
  607. /*
  608.  * kQAOptional_xxx are ORed together to generate the kQAGestalt_OptionalFeatures response
  609.  * from QAEngineGestalt().
  610.  */
  611.  
  612. #define kQAOptional_None            0            /* No optional features */
  613. #define kQAOptional_DeepZ            (1 << 0)    /* Hidden surface precision >= 24 bits */
  614. #define kQAOptional_Texture            (1 << 1)    /* Texture mapping */
  615. #define kQAOptional_TextureHQ        (1 << 2)    /* High quality texture (tri-linear mip or better) */
  616. #define kQAOptional_TextureColor    (1 << 3)    /* Full color modulation and highlight of textures */
  617. #define kQAOptional_Blend            (1 << 4)    /* Transparency blending of RGB */
  618. #define kQAOptional_BlendAlpha        (1 << 5)    /* Transparency blending includes alpha channel */
  619. #define kQAOptional_Antialias        (1 << 6)    /* Antialiased rendering */
  620. #define kQAOptional_ZSorted            (1 << 7)    /* Z sorted rendering (for transparency, etc.) */
  621. #define kQAOptional_PerspectiveZ    (1 << 8)    /* Hidden surface removal using InvW instead of Z */
  622. #define kQAOptional_OpenGL            (1 << 9)    /* Extended rasterization features for OpenGL™ */
  623. #define kQAOptional_NoClear            (1 << 10)    /* This drawing engine doesn't clear before drawing */
  624. #define kQAOptional_CSG                (1 << 11)    /* kQATag_CSGxxx are implemented */
  625. #define kQAOptional_BoundToDevice    (1 << 12)    /* This engine is tightly bound to GDevice */
  626. #define kQAOptional_CL4                (1 << 13)    /* This engine suports kQAPixel_CL4 */
  627. #define kQAOptional_CL8                (1 << 14)    /* This engine suports kQAPixel_CL8 */
  628.  
  629. /*
  630.  * kQAFast_xxx are ORed together to generate the kQAGestalt_FastFeatures response
  631.  * from QAEngineGestalt().
  632.  */
  633.  
  634. #define kQAFast_None                0            /* No accelerated features */
  635. #define kQAFast_Line                (1 << 0)    /* Line drawing */
  636. #define kQAFast_Gouraud                (1 << 1)    /* Gouraud shaded triangles */
  637. #define kQAFast_Texture                (1 << 2)    /* Texture mapped triangles */
  638. #define kQAFast_TextureHQ            (1 << 3)    /* High quality texture (tri-linear mip or better) */
  639. #define kQAFast_Blend                (1 << 4)    /* Transparency blending */
  640. #define kQAFast_Antialiasing        (1 << 5)    /* Antialiased rendering */
  641. #define kQAFast_ZSorted                (1 << 6)    /* Z sorted rendering of non-opaque objects */
  642. #define kQAFast_CL4                    (1 << 7)    /* This engine accelerates kQAPixel_CL4 */
  643. #define kQAFast_CL8                    (1 << 8)    /* This engine accelerates kQAPixel_CL8 */
  644.  
  645. /************************************************************************************************
  646.  *
  647.  * Macro definitions for the drawing engine methods included in TQADrawContext. These
  648.  * macros are the recommended means of accessing the engine's draw methods, e.g:
  649.  *
  650.  *        TQADrawContext    *drawContext;
  651.  *        TQAVTexture        vertices[3];
  652.  *
  653.  *        drawContext = QADrawContextNew (rect, gdevice, engine, kQAContext_ZBuffer);
  654.  *        ...
  655.  *        QASetInt (drawContext, kQATag_ZFunction, kQAZFunction_LT);
  656.  *        QADrawTriGouraud (drawContext, &vertices[0], &vertices[1], &vertices[2], kQATriFlags_None);
  657.  *
  658.  * Note that QARenderStart(), QARenderEnd(), QAFlush() and QASync() have real function
  659.  * definitions instead of macros. This is because these functions can afford the extra
  660.  * per-call overhead of a function layer (which makes application code a little smaller),
  661.  * and to allow a cleaner implementation of handling NULL parameters to QARenderStart().
  662.  *
  663.  ***********************************************************************************************/
  664.  
  665. #define QASetFloat(drawContext,tag,newValue) \
  666.         (drawContext)->setFloat (drawContext,tag,newValue)
  667.  
  668. #define QASetInt(drawContext,tag,newValue) \
  669.         (drawContext)->setInt (drawContext,tag,newValue)
  670.  
  671. #define QASetPtr(drawContext,tag,newValue) \
  672.         (drawContext)->setPtr (drawContext,tag,newValue)
  673.  
  674. #define QAGetFloat(drawContext,tag) \
  675.         (drawContext)->getFloat (drawContext,tag)
  676.  
  677. #define QAGetInt(drawContext,tag) \
  678.         (drawContext)->getInt (drawContext,tag)
  679.  
  680. #define QAGetPtr(drawContext,tag) \
  681.         (drawContext)->getPtr (drawContext,tag)
  682.  
  683. #define QADrawPoint(drawContext,v) \
  684.         (drawContext)->drawPoint (drawContext,v)
  685.  
  686. #define QADrawLine(drawContext,v0,v1) \
  687.         (drawContext)->drawLine (drawContext,v0,v1)
  688.  
  689. #define QADrawTriGouraud(drawContext,v0,v1,v2,flags) \
  690.         (drawContext)->drawTriGouraud (drawContext,v0,v1,v2,flags)
  691.  
  692. #define QADrawTriTexture(drawContext,v0,v1,v2,flags) \
  693.         (drawContext)->drawTriTexture (drawContext,v0,v1,v2,flags)
  694.  
  695. #define QASubmitVerticesGouraud(drawContext,nVertices,vertices) \
  696.         (drawContext)->submitVerticesGouraud(drawContext,nVertices,vertices)
  697.         
  698. #define QASubmitVerticesTexture(drawContext,nVertices,vertices) \
  699.         (drawContext)->submitVerticesTexture(drawContext,nVertices,vertices)
  700.         
  701. #define QADrawTriMeshGouraud(drawContext,nTriangle,triangles) \
  702.         (drawContext)->drawTriMeshGouraud (drawContext,nTriangle,triangles)
  703.  
  704. #define QADrawTriMeshTexture(drawContext,nTriangle,triangles) \
  705.         (drawContext)->drawTriMeshTexture (drawContext,nTriangle,triangles)
  706.  
  707. #define QADrawVGouraud(drawContext,nVertices,vertexMode,vertices,flags) \
  708.         (drawContext)->drawVGouraud (drawContext,nVertices,vertexMode,vertices,flags)
  709.  
  710. #define QADrawVTexture(drawContext,nVertices,vertexMode,vertices,flags) \
  711.         (drawContext)->drawVTexture (drawContext,nVertices,vertexMode,vertices,flags)
  712.  
  713. #define QADrawBitmap(drawContext,v,bitmap) \
  714.         (drawContext)->drawBitmap (drawContext,v,bitmap)
  715.  
  716. #define QARenderStart(drawContext,dirtyRect,initialContext) \
  717.         (drawContext)->renderStart (drawContext,dirtyRect,initialContext)
  718.  
  719. #define QARenderEnd(drawContext,modifiedRect) \
  720.         (drawContext)->renderEnd (drawContext,modifiedRect)
  721.  
  722. #define QARenderAbort(drawContext) \
  723.         (drawContext)->renderAbort (drawContext)
  724.  
  725. #define QAFlush(drawContext) \
  726.         (drawContext)->flush (drawContext)
  727.  
  728. #define QASync(drawContext) \
  729.         (drawContext)->sync (drawContext)
  730.  
  731. #ifdef RAVE_1_1
  732.  
  733. #define QASetNoticeMethod(drawContext, method, completionCallBack, refCon) \
  734.         (drawContext)->setNoticeMethod (drawContext, method, completionCallBack, refCon)
  735.  
  736. #define QAGetNoticeMethod(drawContext, method, completionCallBack, refCon) \
  737.         (drawContext)->getNoticeMethod (drawContext, method, completionCallBack, refCon)
  738.  
  739. #endif
  740.  
  741. /************************************************************************************************
  742.  *
  743.  * Typedefs of draw method functions provided by the drawing engine. One function pointer
  744.  * for each of these function types in stored in the TQADrawContext public data structure.
  745.  *
  746.  * These functions should be accessed through the QA<function>(context,...) macros,
  747.  * defined above.
  748.  *
  749.  ***********************************************************************************************/
  750.  
  751. #ifdef RAVE_1_1
  752.  
  753. typedef void (*TQANoticeMethod)(
  754.     TQADrawContext            *drawContext,        /* Draw context */
  755.     void                    *refCon);
  756.  
  757. #endif
  758.  
  759. typedef void (*TQASetFloat) (
  760.     TQADrawContext            *drawContext,        /* Draw context */
  761.     TQATagFloat                tag,                /* Tag of variable to set */
  762.     float                    newValue);            /* New value for variable */
  763.  
  764. typedef void (*TQASetInt) (
  765.     TQADrawContext            *drawContext,        /* Draw context */
  766.     TQATagInt                tag,                /* Tag of variable to set */
  767.     unsigned long            newValue);            /* New value for variable */
  768.  
  769. typedef void (*TQASetPtr) (
  770.     TQADrawContext            *drawContext,        /* Draw context */
  771.     TQATagPtr                tag,                /* Tag of variable to set */
  772.     const void                *newValue);            /* New value for variable */
  773.  
  774. typedef float (*TQAGetFloat) (
  775.     const TQADrawContext    *drawContext,        /* Draw context */
  776.     TQATagFloat                tag);                /* Tag of variable to get */
  777.  
  778. typedef unsigned long (*TQAGetInt) (
  779.     const TQADrawContext    *drawContext,        /* Draw context */
  780.     TQATagInt                tag);                /* Tag of variable to get */
  781.  
  782. typedef void *(*TQAGetPtr) (
  783.     const TQADrawContext    *drawContext,        /* Draw context */
  784.     TQATagPtr                tag);                /* Tag of variable to get */
  785.  
  786. typedef void (*TQADrawPoint) (
  787.     const TQADrawContext    *drawContext,        /* Draw context */
  788.     const TQAVGouraud        *v);                /* Vertex */
  789.  
  790. typedef void (*TQADrawLine) (
  791.     const TQADrawContext    *drawContext,        /* Draw context */
  792.     const TQAVGouraud         *v0,                /* Vertex 0 */
  793.     const TQAVGouraud         *v1);                /* Vertex 1 */
  794.  
  795. typedef void (*TQADrawTriGouraud) (
  796.     const TQADrawContext    *drawContext,        /* Draw context */
  797.     const TQAVGouraud         *v0,                /* Vertex 0 */
  798.     const TQAVGouraud         *v1,                /* Vertex 1 */
  799.     const TQAVGouraud         *v2,                /* Vertex 2 */
  800.     unsigned long            flags);                /* Mask of kQATriFlags_xxx flags */
  801.  
  802. typedef void (*TQADrawTriTexture) (
  803.     const TQADrawContext    *drawContext,        /* Draw context */
  804.     const TQAVTexture         *v0,                /* Vertex 0 */
  805.     const TQAVTexture         *v1,                /* Vertex 1 */
  806.     const TQAVTexture         *v2,                /* Vertex 2 */
  807.     unsigned long            flags);                /* Mask of kQATriFlags_xxx flags */
  808.  
  809. typedef void (*TQASubmitVerticesGouraud) (
  810.     const TQADrawContext        *drawContext,    /* Draw context */
  811.     unsigned long                 nVertices,        /* Number of vertices */
  812.     const TQAVGouraud             *vertices);        /* Array of vertices */
  813.     
  814. typedef void (*TQASubmitVerticesTexture) (
  815.     const TQADrawContext        *drawContext,    /* Draw context */
  816.     unsigned long                 nVertices,        /* Number of vertices */
  817.     const TQAVTexture            *vertices);        /* Array of vertices */
  818.     
  819. typedef void (*TQADrawTriMeshGouraud) (
  820.     const TQADrawContext        *drawContext,    /* Draw context */
  821.     unsigned long                 nTriangles,        /* Number of triangles */
  822.     const TQAIndexedTriangle    *triangles);    /* Array of triangles */
  823.     
  824. typedef void (*TQADrawTriMeshTexture) (
  825.     const TQADrawContext        *drawContext,    /* Draw context */
  826.     unsigned long                 nTriangles,        /* Number of triangles */
  827.     const TQAIndexedTriangle     *triangles);    /* Array of triangles */
  828.  
  829. typedef void (*TQADrawVGouraud) (
  830.     const TQADrawContext    *drawContext,        /* Draw context */
  831.     unsigned long            nVertices,            /* Number of vertices */
  832.     TQAVertexMode            vertexMode,            /* One of kQAVertexMode_xxx enumerated values */
  833.     const TQAVGouraud         vertices[],            /* Array of vertices */
  834.     const unsigned long        flags[]);            /* Array of per-triangle flags (or NULL) */
  835.  
  836. typedef void (*TQADrawVTexture) (
  837.     const TQADrawContext    *drawContext,        /* Draw context */
  838.     unsigned long            nVertices,            /* Number of vertices */
  839.     TQAVertexMode            vertexMode,            /* One of kQAVertexMode_xxx enumerated values */
  840.     const TQAVTexture         vertices[],            /* Array of vertices */
  841.     const unsigned long        flags[]);            /* Array of per-triangle flags (or NULL) */
  842.  
  843. typedef void (*TQADrawBitmap) (
  844.     const TQADrawContext    *drawContext,        /* Draw context */
  845.     const TQAVGouraud         *v,                    /* xyz, and (if a 1 bit/pixel bitmap) argb */
  846.     TQABitmap                *bitmap);            /* Previously allocated by QABitmapNew() */
  847.  
  848. typedef void (*TQARenderStart) (
  849.     const TQADrawContext    *drawContext,        /* Draw context */
  850.     const TQARect            *dirtyRect,            /* Minimum area to clear; NULL means whole buffer */
  851.     const TQADrawContext    *initialContext);    /* Initial background image (or NULL) */
  852.  
  853. typedef TQAError (*TQARenderEnd) (
  854.     const TQADrawContext    *drawContext,        /* Draw context */
  855.     const TQARect            *modifiedRect);        /* Minimum area to swap; NULL means whole buffer */
  856.  
  857. typedef TQAError (*TQARenderAbort) (
  858.     const TQADrawContext    *drawContext);        /* Draw context */
  859.  
  860. typedef TQAError (*TQAFlush) (
  861.     const TQADrawContext    *drawContext);        /* Draw context */
  862.  
  863. typedef TQAError (*TQASync) (
  864.     const TQADrawContext    *drawContext);        /* Draw context */
  865.  
  866. #ifdef RAVE_1_1
  867.  
  868. typedef TQAError (*TQASetNoticeMethod)(
  869.     const TQADrawContext    *drawContext,    /* Draw context */
  870.     TQAMethodSelector        method,
  871.     TQANoticeMethod            completionCallBack,
  872.     void                    *refCon);
  873.  
  874. typedef TQAError (*TQAGetNoticeMethod)(
  875.     const TQADrawContext    *drawContext,    /* Draw context */
  876.     TQAMethodSelector        method,
  877.     TQANoticeMethod            *completionCallBack,
  878.     void                    **refCon);
  879.  
  880. #endif
  881.  
  882. /************************************************************************************************
  883.  *
  884.  * Public TQADrawContext structure. This contains function pointers for the chosen
  885.  * drawing engine.
  886.  *
  887.  ***********************************************************************************************/
  888.  
  889. /*
  890.  * TQAVersion sets the TQADrawContext 'version' field. It is set by
  891.  * the manager to indicate the version of the TQADrawContext structure.
  892.  */
  893.  
  894. typedef enum TQAVersion
  895. {
  896.     kQAVersion_Prerelease        = 0,
  897.     kQAVersion_1_0                = 1,
  898.     kQAVersion_1_1                = 2        /* Added tri mesh functions, color tables */
  899. } TQAVersion;
  900.  
  901. struct TQADrawContext
  902. {
  903.     TQADrawPrivate            *drawPrivate;        /* Engine's private data for this context */
  904.     const TQAVersion        version;            /* Version number */
  905.     TQASetFloat                setFloat;            /* Method: Set a float state variable */
  906.     TQASetInt                setInt;                /* Method: Set an unsigned long state variable */
  907.     TQASetPtr                setPtr;                /* Method: Set an unsigned long state variable */
  908.     TQAGetFloat                getFloat;            /* Method: Get a float state variable */
  909.     TQAGetInt                getInt;                /* Method: Get an unsigned long state variable */
  910.     TQAGetPtr                getPtr;                /* Method: Get an pointer state variable */
  911.     TQADrawPoint            drawPoint;            /* Method: Draw a point */
  912.     TQADrawLine                drawLine;            /* Method: Draw a line */
  913.     TQADrawTriGouraud        drawTriGouraud;        /* Method: Draw a Gouraud shaded triangle */
  914.     TQADrawTriTexture        drawTriTexture;        /* Method: Draw a texture mapped triangle */
  915.     TQADrawVGouraud            drawVGouraud;        /* Method: Draw Gouraud vertices */
  916.     TQADrawVTexture            drawVTexture;        /* Method: Draw texture vertices */
  917.     TQADrawBitmap            drawBitmap;            /* Method: Draw a bitmap */
  918.     TQARenderStart            renderStart;        /* Method: Initialize for rendering */
  919.     TQARenderEnd            renderEnd;            /* Method: Complete rendering and display */
  920.     TQARenderAbort            renderAbort;        /* Method: Abort any outstanding rendering (blocking) */
  921.     TQAFlush                flush;                /* Method: Start render of any queued commands (non-blocking) */
  922.     TQASync                    sync;                /* Method: Wait for completion of all rendering (blocking) */
  923.     TQASubmitVerticesGouraud    submitVerticesGouraud;    /* Method: Submit Gouraud vertices for trimesh */
  924.     TQASubmitVerticesTexture    submitVerticesTexture;    /* Method: Submit Texture vertices for trimesh */
  925.     TQADrawTriMeshGouraud        drawTriMeshGouraud;        /* Method: Draw a Gouraud triangle mesh */
  926.     TQADrawTriMeshTexture        drawTriMeshTexture;        /* Method: Draw a Texture triangle mesh */
  927. };
  928.  
  929. /************************************************************************************************
  930.  *
  931.  * Acceleration manager function prototypes.
  932.  *
  933.  ***********************************************************************************************/
  934.  
  935. RAVE_EXPORT TQAError QADrawContextNew (
  936.     const TQADevice    *device,                /* Target device */
  937.     const TQARect    *rect,                    /* Target rectangle (device coordinates) */
  938.     const TQAClip    *clip,                    /* 2D clip region */
  939.     const TQAEngine    *engine,                /* Drawing engine to use */
  940.     unsigned long    flags,                    /* Mask of kQAContext_xxx */
  941.     TQADrawContext    **newDrawContext);        /* (Out) Newly created TQADrawContext */
  942.  
  943. RAVE_EXPORT void QADrawContextDelete (
  944.     TQADrawContext    *drawContext);            /* Context to delete */
  945.  
  946. RAVE_EXPORT TQAError QAColorTableNew(
  947.     const TQAEngine        *engine,            /* Drawing engine to use */
  948.     TQAColorTableType    tableType,            /* Depth, color space, etc. */
  949.     void                *pixelData,            /* lookup table entries in pixelType format */
  950.     long                transparentIndexFlag,    /* boolean, false means no transparency, true means index 0 is transparent */
  951.     TQAColorTable        **newTable);        /* (Out) Newly created TQAColorTable */
  952.  
  953. RAVE_EXPORT void QAColorTableDelete(
  954.     const TQAEngine        *engine,            /* Drawing engine to use */
  955.     TQAColorTable        *colorTable);        /* Previously allocated by QAColorTableNew() */
  956.  
  957. RAVE_EXPORT TQAError QATextureNew (
  958.     const TQAEngine        *engine,            /* Drawing engine to use */
  959.     unsigned long        flags,                /* Mask of kQATexture_xxx flags */
  960.     TQAImagePixelType    pixelType,            /* Depth, color space, etc. */
  961.     const TQAImage        images[],            /* Image(s) for texture */
  962.     TQATexture            **newTexture);        /* (Out) Newly created TQATexture, or NULL on error */ 
  963.  
  964. RAVE_EXPORT TQAError QATextureDetach (
  965.     const TQAEngine        *engine,            /* Drawing engine to use */
  966.     TQATexture            *texture);            /* Previously allocated by QATextureNew() */
  967.  
  968. RAVE_EXPORT void QATextureDelete (
  969.     const TQAEngine        *engine,            /* Drawing engine to use */
  970.     TQATexture            *texture);            /* Previously allocated by QATextureNew() */
  971.  
  972. RAVE_EXPORT TQAError QATextureBindColorTable(
  973.     const TQAEngine        *engine,            /* Drawing engine to use */
  974.     TQATexture            *texture,            /* Previously allocated by QATextureNew() */
  975.     TQAColorTable        *colorTable);        /* Previously allocated by QAColorTableNew() */
  976.     
  977. RAVE_EXPORT TQAError QABitmapNew (
  978.     const TQAEngine        *engine,            /* Drawing engine to use */
  979.     unsigned long        flags,                /* Mask of kQABitmap_xxx flags */
  980.     TQAImagePixelType    pixelType,            /* Depth, color space, etc. */
  981.     const TQAImage        *image,                /* Image */
  982.     TQABitmap            **newBitmap);        /* (Out) Newly created TQABitmap, or NULL on error */ 
  983.  
  984. RAVE_EXPORT TQAError QABitmapDetach (
  985.     const TQAEngine        *engine,            /* Drawing engine to use */
  986.     TQABitmap            *bitmap);            /* Previously allocated by QABitmapNew() */
  987.  
  988. RAVE_EXPORT void QABitmapDelete (
  989.     const TQAEngine        *engine,            /* Drawing engine to use */
  990.     TQABitmap            *bitmap);            /* Previously allocated by QABitmapNew() */
  991.  
  992. RAVE_EXPORT TQAError QABitmapBindColorTable(
  993.     const TQAEngine        *engine,            /* Drawing engine to use */
  994.     TQABitmap            *bitmap,            /* Previously allocated by QABitmapNew() */
  995.     TQAColorTable        *colorTable);        /* Previously allocated by QAColorTableNew() */
  996.     
  997. RAVE_EXPORT TQAEngine *QADeviceGetFirstEngine (
  998.     const TQADevice    *device);                /* Target device */
  999.  
  1000. RAVE_EXPORT TQAEngine *QADeviceGetNextEngine (
  1001.     const TQADevice    *device,                /* Target device */
  1002.     const TQAEngine    *currentEngine);        /* Engine after 'currentEngine' is returned */
  1003.  
  1004. RAVE_EXPORT TQAError QAEngineCheckDevice (
  1005.     const TQAEngine    *engine,                /* Engine to check on 'device' */
  1006.     const TQADevice    *device);                /* Target device */
  1007.  
  1008. RAVE_EXPORT TQAError QAEngineGestalt (
  1009.     const TQAEngine        *engine,            /* Engine being queried */
  1010.     TQAGestaltSelector    selector,            /* Gestalt parameter being requested */
  1011.     void                *response);            /* Buffer that receives response */
  1012.  
  1013. RAVE_EXPORT TQAError QAEngineEnable (
  1014.     long            vendorID,                /* Vendor ID of engine to enable */
  1015.     long            engineID);                /* Engine ID of engine to enable */
  1016.  
  1017. RAVE_EXPORT TQAError QAEngineDisable (
  1018.     long            vendorID,                /* Vendor ID of engine to disable */
  1019.     long            engineID);                /* Engine ID of engine to disable */
  1020.  
  1021. #ifdef __cplusplus
  1022. }
  1023. #endif
  1024.  
  1025. #endif /* _RAVE_h */
  1026.